package com.aididi.spring.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;

/**
 * @Auther: zx.xu
 * @Description:    监听事件
 */
@Component
public class MyTransactionListener {

/*

    @Autowired
    private PackageInfoMapper packageInfoMapper;

    @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
    private void onHelloEvent(MyAfterTransactionEvent event) {
        threadPoolTaskExecutor.submit(() -> {
            //查询id为1的数据
            List<OrderPackageInfo> orderPackageInfo = packageInfoMapper.select(packageInfo.getOrderNo);
            // todo把数据发送发给第三方

        });
    }
*/

}
